{% extends "WileadUserManagerBundle::layout.html.twig" %}

{% block container -%}
<form method="get" action="">
    {{ form_rest(filter) }}
        <input class="btn btn-info" type="submit" name="submit-filter" value="搜索" />
        <a class="btn" href="{{ path('manager_job') }}">清空条件</a>
    </form>
    <h1>招聘管理</h1>

    <table class="table">
        <thead>
            <tr>
                <th>标题</th>
                <th>介绍</th>
                <th>要求</th>
                <th>发布用户</th>
                <th>结束时间</th>
                <th>发布时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
        {% for entity in entities %}
                <tr>
                    <td>{{ entity.title }}</td>
                    <td>{{ entity.description }}</td>
                    <td>{{ entity.demand }}</td>
                    <td><a href="{{ path('manager_user_show', { 'id': entity.User.id }) }}">{{ entity.User.nickname }}</a></td>
                    <td>{% if entity.deadline %}{{ entity.deadline|date('Y-m-d H:i:s') }}{% endif %}</td>
                    <td>{% if entity.created %}{{ entity.created|date('Y-m-d H:i:s') }}{% endif %}</td>
                    <td>
                        <ul>
                            <li>
                                <a href="{{ path('manager_job_show', { 'id': entity.id }) }}">查看</a>
                                <a class="deleteLink" href="{{ path('manager_job_delete', { 'id': entity.id }) }}">删除</a>
                            </li>
                        </ul>
                    </td>
                </tr>
        {% endfor %}
            </tbody>
        </table>

    {% endblock %}

    {% block javascript %}
{{ parent() }}
        <script>
            $(document).ready(function() {
                $('#wilead_iartistbundle_job_filter_deadline_left_date, #wilead_iartistbundle_job_filter_deadline_right_date').datepicker({
                    format: 'yyyy-mm-dd',
                    language: 'zh-CN'
                });
            });
            </script>
{% endblock javascript %}